#include<stdio.h>

void fan(int num[10])
{
	int i = 0, j = 4,ret=1;
	while (j < 10)
	{
		for (int o = i, p = j; p > (o + p) / 2; o++, p--)
		{
			if (ret % 2 == 0)
			{
				int temp = num[o];
				num[o] = num[p];
				num[p] = temp;
			}

		}
		i += 5;
		j += 5;
		ret++;
	}
	
}

void fan2(int num[3][10])
{
	for (int q = 0; q < 3; q++)
	{
		int i = 0, j = 4, ret = 1;
		while (j < 10)
		{
			for (int o = i, p = j; p > (o + p) / 2; o++, p--)
			{
				if (ret % 2 == 0)
				{
					int temp = num[q][o];
					num[q][o] = num[q][p];
					num[q][p] = temp;
				}

			}
			i += 5;
			j += 5;
			ret++;
		}
	}
}

int main()
{
	int num[3][10] = { {1,2,3,4,5,6,7,8,9,0 },
		{1,2,3,4,5,6,7,8,9,0},
		{8,2,3,5,1,6,8,0,3,2}
};

	
	fan2(num);
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			printf("%d", num[i][j]);

		}
		printf("\n");
	}
	printf("%d", 15 / 2);
	return 0;
}